home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / getgrent.man < prev    next >
Encoding:
Text File  |  1989-01-14  |  2.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GETGRENT              C Library Procedures               GETGRENT
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      getgrent, getgrgid, getgrnam, setgrent, endgrent setgrfile -
  10.      get group file entry
  11.  
  12. SSYYNNOOPPSSIISS
  13.      ##iinncclluuddee <<ggrrpp..hh>>
  14.  
  15.      ssttrruucctt ggrroouupp **ggeettggrreenntt(())
  16.  
  17.      ssttrruucctt ggrroouupp **ggeettggrrggiidd((ggiidd))
  18.      iinntt ggiidd;;
  19.  
  20.      ssttrruucctt ggrroouupp **ggeettggrrnnaamm((nnaammee))
  21.      cchhaarr **nnaammee;;
  22.  
  23.      sseettggrreenntt(())
  24.  
  25.      eennddggrreenntt(())
  26.  
  27.      sseettggrrffiillee((nnaammee))
  28.      cchhaarr **nnaammee;;
  29.  
  30. DDEESSCCRRIIPPTTIIOONN
  31.      _G_e_t_g_r_e_n_t, _g_e_t_g_r_g_i_d and _g_e_t_g_r_n_a_m each return pointers to an
  32.      object with the following structure containing the broken-
  33.      out fields of a line in the group file.
  34.  
  35.           /*   @(#)grp.h 1.1 86/07/07 SMI; from UCB 4.1 83/05/03 */
  36.  
  37.           struct    group { /* see getgrent(3) */
  38.                char *gr_name;
  39.                char *gr_passwd;
  40.                int  gr_gid;
  41.                char **gr_mem;
  42.           };
  43.  
  44.           struct group *getgrent(), *getgrgid(), *getgrnam();
  45.  
  46.      The members of this structure are:
  47.  
  48.      gr_name    The name of the group.
  49.      gr_passwd  The encrypted password of the group.
  50.      gr_gid     The numerical group-ID.
  51.      gr_mem     Null-terminated vector of pointers to the indivi-
  52.                 dual member names.
  53.  
  54.      _G_e_t_g_r_e_n_t simply reads the next line while _g_e_t_g_r_g_i_d and _g_e_t_-
  55.      _g_r_n_a_m search until a matching _g_i_d or _n_a_m_e is found (or until
  56.      EOF is encountered).  Each routine picks up where the others
  57.      leave off so successive calls may be used to search the
  58.      entire file.
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0             November 5, 1987                        1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GETGRENT              C Library Procedures               GETGRENT
  71.  
  72.  
  73.  
  74.      A call to _s_e_t_g_r_e_n_t has the effect of rewinding the group
  75.      file to allow repeated searches.  _E_n_d_g_r_e_n_t may be called to
  76.      close the group file when processing is complete.
  77.  
  78.      _S_e_t_g_r_f_i_l_e changes the default group file to _n_a_m_e thus allow-
  79.      ing alternate grioup files to be used.  Note that it does
  80.      _n_o_t close the previous file.  If this is desired, _e_n_d_g_r_e_n_t
  81.      should be called prior to it.
  82.  
  83. FFIILLEESS
  84.      /etc/group
  85.  
  86. SSEEEE AALLSSOO
  87.      getlogin(3), getpwent(3), group(5)
  88.  
  89. DDIIAAGGNNOOSSTTIICCSS
  90.      A null pointer (0) is returned on EOF or error.
  91.  
  92. BBUUGGSS
  93.      All information is contained in a static area so it must be
  94.      copied if it is to be saved.
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0             November 5, 1987                        2
  130.  
  131.  
  132.  
  133.